import request from '@/router/axios'
import {fenExYuangettoFixed, getLineName, getStationName} from "../../../../../subwayRat/commonCheck";
import store from '@/store';

export const TVMRJZDJ_tableOption = {
  emptyBtn:false,
  border: true,
  index: true,
  indexLabel: '序号',
  selection: true,
  reserveSelection:true,
  stripe: true,
  menuAlign: 'center',
  menuWidth:150,
  editBtn: false,
  delBtn: false,
  align: 'center',
  addBtn: false,
  column: [{label:"线路名称",
    prop:"lineCode",search:true,searchslot:true,formatter: function(row, value , label, column){
      return getLineName(value);
    }},

    {label:"站点名称",
      prop:"stationCode",search:true,searchslot:true,formatter: function(row, value , label, column){
        return getStationName(row.lineCode,value);
      }},

    {label:"开始时间",
      prop:"startTime",type:'date',format:'yyyy-MM-dd'},
    {label:"结束时间",
      prop:"endTime",type:'date',format:'yyyy-MM-dd'},
    {label:"TVM编号",
      prop:"tvmCode"},

    {label:"现金支付总计",width:120,
      prop:"dailyCashTotalAmount",formatter:function (row,value , label, column) {
        if(!value){
          return '';
        }
        return fenExYuangettoFixed(row,'dailyCashTotalAmount');
      }},

    {label:"电子支付总计",width:120,
      prop:"electronicPayTotalAmount",formatter:function (row,value , label, column) {
        if(!value){
          return '';
        }
        return fenExYuangettoFixed(row,'electronicPayTotalAmount');
      }},

    {label:"操作员",
      prop:"operatorName"},

    {label:"操作员工号",width:100,
      prop:"operatorJobNo",search:true,searchslot:true},

    {label:"数据来源",
      prop:"dataSource",type:'select',search:true,dicData:[{label:'车站录入',value:1},{label:'线路录入',value:2}],formatter: function(row, value , label, column){
        return value=='1'?"车站录入":(value=='2'?"线路录入":"");
      }}]
};

/**
 *  结账单据查询
 * @param param
 * @returns {*}
 */
export function get_xw_SwAuTvmDailyBillAssistList(param) {
  return request({
    url: '/check/checkNew/get_xw_SwAuTvmDailyBillAssistList',
    method: 'post',
    params: param
  })
}

/**
 *  结账单据详情查询
 * @param param
 * @returns {*}
 */
export function get_xw_SwAuTvmDailyBillAssistDetail(param) {
  return request({
    url: '/check/checkNew/get_xw_SwAuTvmDailyBillAssistDetail',
    method: 'post',
    params: param
  })
}


/**
 * 编辑
 * @param param
 * @returns {*}
 */
export function editor_xw_SwAuTvmDailyBillAssistDetail(param) {
  return request({
    url: '/check/checkNew/editor_xw_SwAuTvmDailyBillAssistDetail',
    method: 'post',
    data: param,
    params: param
  })
}

/**
 * 编辑
 * @param param
 * @returns {*}
 */
export function submitData_xw_SwAuTvmDailyBillAssistDetail(param) {
  return request({
    url: '/check/checkNew/submitData_xw_SwAuTvmDailyBillAssistDetail',
    method: 'post',
    //params: param
    data: param
  })
}

